home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / networking / 3228 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  12.4 KB

  1. Path: comma.rhein.de!serpens!not-for-mail
  2. From: mlelstv@serpens.rhein.de (Michael van Elst)
  3. Newsgroups: comp.sys.amiga.networking
  4. Subject: Re: Announce: AWeb 1.0 released!
  5. Date: 30 Mar 1996 14:19:03 +0100
  6. Organization: dis-
  7. Message-ID: <4jjcc7$hm4@serpens.rhein.de>
  8. References: <4iva78$5pa@news.xs4all.nl> <4j1f6e$984@news.uni-c.dk> <jasonb.827822336@cs.uwa.edu.au> <4j8o6r$9vj@serpens.rhein.de> <jasonb.827896888@cs.uwa.edu.au> <4jaue8$jh4@serpens.rhein.de> <jasonb.827996764@cs.uwa.edu.au> <4je3qj$kk@serpens.rhein.de> <jasonb.828076494@cs.uwa.edu.au> <4jgdfr$8f4@serpens.rhein.de> <jasonb.828104646@cs.uwa.edu.au> <4jh986$a5o@serpens.rhein.de> <jasonb.828179619@cs.uwa.edu.au>
  9. NNTP-Posting-Host: serpens.rhein.de
  10.  
  11. jasonb@cs.uwa.edu.au (Jason S Birch) writes:
  12.  
  13. >Unix or NT. It's hardly going to be much of an advantage if we're all
  14. >too afraid to move anything below 0, now, is it?
  15.  
  16. But why should every single program manage priorities when there is
  17. a more easy solution ?
  18.  
  19. >Yes. And for a long time now, we've been able to modify it.
  20.  
  21. This doesn't mean that every program has to do this.
  22.  
  23. >>So provide timely feedback as AmigaOS did it all the time: by using
  24. >>input.device. It exists, it is the standard, it works well, you don't
  25. >>need a scheduler that outguesses a programs intention.
  26.  
  27. >It also means that every class of MUI would be running at pri 20
  28.  
  29. This is rubbish. The only thing that runs at pri 20 is the event
  30. handling. This is what already happens. But MUI classes defer everything
  31. to the application. The right way is to defer only the slow operations
  32. to the application (or another low priority task).
  33.  
  34. >you prefer: MUI apps running the bulk of their code at pri 20 because
  35. >the programmer didn't know any better, or MUI apps running the bulk of
  36. >their code at pri 0?
  37.  
  38. Programmers that _use_ a GUI toolkit do not care about this. Programmers
  39. of new classes have to care.
  40.  
  41. >I believe ClassAct also does this, but makes
  42. >it easy for the programmer to put parts of the custom class on the
  43. >application's context if they feel it would take too long.
  44.  
  45. ClassAct doesn't make it easier. It isn't actually difficult.
  46.  
  47. >It is if you want to keep notification working on everything and you
  48. >don't want the programmer to have to deal with the internals of your
  49. >OO system (BOOPSI).
  50.  
  51. Programmers that use the toolkit do not have care about any internals
  52. and programmers of new classes have to know the internals of the toolkit.
  53. There is no difference.
  54.  
  55. >No -- because the OO system *itself* doesn't run at different
  56. >priorities.
  57.  
  58. I am sorry. You have some wrong ideas about what "the OO system" is.
  59. MUI uses BOOPSI too, the OO system does run at the priority you use it
  60. at.
  61.  
  62. >Within a custom class, the OO mechanism is still running on
  63. >the same context as the rest of the classes.
  64.  
  65. No. If you invoke a method from the user's program the priority isn't
  66. suddenly changed and the method is not executed by input.device.
  67.  
  68. >Any method you call, any
  69. >attribute you set, is all still on the same context.
  70.  
  71. Sorry, this is completely wrong.
  72.  
  73. >Internal functions
  74. >to your class can be running on different contexts, but that has
  75. >nothing to do with your OO mechanism.
  76.  
  77. As I said, MUI uses the same OO mechanism as gadgetclass.
  78.  
  79. >Within those other contexts, you
  80. >can't call methods and set attributes of other objects directly.
  81.  
  82. This is wrong. Of course you can do this. In fact, even simple
  83. gadgetclass objects are created and configured on the application
  84. context, event handling and refresh are done on input.device context.
  85.  
  86. >It
  87. >would get very messy to implement if you could, and you would need to
  88. >implement it that way if you didn't want the whole thing running at
  89. >pri 20 by default.
  90.  
  91. The methods do not run at pri 20 by default. And if you look at
  92. datatypes (which are just special versions of gadgetclass) you see
  93. that these can offload operations to a separate task or to the
  94. application (by sending a sync message).
  95.  
  96. >>>So MUI does it all on the usual
  97. >>>priority task's context, which makes MUI simpler but means the
  98. >>>programmer has to be aware of the issues of GUI responsiveness and
  99. >>>ensure his event handling loop is always ready and waiting.
  100.  
  101. >>Which is more difficult and interferes with more programs than simple
  102. >>semaphore locking of data structures.
  103.  
  104. >Why is it more difficult?
  105.  
  106. Because you cannot ensure that the event handling loop is always
  107. ready and waiting. Another task at default priority can slow down
  108. your loop. There is no way to change that but to control priorities
  109. of all tasks.
  110.  
  111. On the other hand it is simple to rely on input.device to run at pri
  112. 20 ahead of all other tasks.
  113.  
  114. >>Sure. I never said that existing BOOPSI gadgets are perfect but
  115. >>datatypes already provide a method to offload expensive operations.
  116. >>This is a function of the datatypes.library.
  117.  
  118. >That's right -- the *programmer* is left the task of offloading
  119. >expensive operations,
  120.  
  121. No. If you use MUI _then_ the programmer is left the task of offloading
  122. expensive operations. With datatypes this is done by the datatype
  123. itself.
  124.  
  125. So writing of new classes is more difficult and writing of programs
  126. that use the classes is easier.
  127.  
  128. >sluggish. A complex AmigaGuide document can stop my mouse pointer
  129. >moving for a second or more.
  130.  
  131. As I said this is a flaw in the AmigaGuide datatype.
  132.  
  133. >Applications running CPU intensive tasks at pri 0 have always been
  134. >annoying, because they make the system sluggish -- but at least we've
  135. >always been able to move them if necessary.
  136.  
  137. CPU intensive tasks aren't just programs that consume all the CPU time.
  138. For other programs, especially those with interactive input you'd have
  139. to change the priority all the time.
  140.  
  141. >If they take long enough for you to want to do something else
  142. >interactive in the meantime, think about using ChangeTaskPri, or Scout,
  143. >or ARTM. Or use Executive, and let it happen automatically.
  144.  
  145. Or use a sensible scheme in your GUI toolkit so that this isn't a
  146. problem.
  147.  
  148. >>You do not need to write special code to keep MUI and Executive happy.
  149. >>That's what it is.
  150.  
  151. >Again. Sigh... This has nothing to do with MUI and Executive.
  152.  
  153. It has.
  154.  
  155. >Running
  156. >CPU intensive processes at pri 0 *will* make the machine feel slower.
  157.  
  158. That's why you do not want to run the GUI at this priority.
  159.  
  160. >You *will* notice the effect in your text editor.
  161.  
  162. But you do not have to notice this in your GUI.
  163.  
  164. >You *will* notice
  165. >that, while a button still depresses instantly, the application takes
  166. >longer to respond.
  167.  
  168. That's obvious. If the machine is busy then it becomes slower.
  169.  
  170. >>Run a MUI program. Run another CPU-intensive program at the same
  171. >>priority (i.e. 0: the default priority). Watch the MUI program to
  172. >>become sluggish (if it isn't already).
  173.  
  174. >Watch your text editor also become sluggish.
  175.  
  176. This depends on your text editor. A text editor based on BOOPSI code
  177. wouldn't become sluggish.
  178.  
  179. >Listviews will be slow to scroll. All of this is unnecessary, because
  180. >it would all disappear if only the CPU intensive program was running
  181. >at a lower priority.
  182.  
  183. This doesn't mean that you _have to_ lower the priority to keep the GUI
  184. happy.
  185.  
  186. >It isn't responsive if (gasp) I run another CPU intensive task at
  187. >priority 0,
  188.  
  189. It is more responsive than a MUI application under the same condition.
  190.  
  191. >or if it's coping with many connections and image
  192. >decompressions while I'm trying to scroll through a large document.
  193.  
  194. Overloading a machine is never fast and changing priorities won't
  195. change that.
  196.  
  197. >If the CPU intensive tasks it spawns ran at a lower priority, it would
  198. >be. (This is without running Executive, BTW.)
  199.  
  200. Sure. But with Executive the various CPU intensive tasks do not
  201. timeslice any longer (a 1 second timeslice is ridiculous).
  202.  
  203. >Many programs (eg. Real3D, IBrowse) spawn subtasks to do CPU intensive
  204. >tasks. (Note that *only* CPU intensive programs need do this, other
  205. >"standard programs" make no difference.)
  206.  
  207. I'm talking about close to any program. Even DIR or LIST have to
  208. change priorities fore and back because they possibly sort the output.
  209. Evey standard ANSI C program would have to be modified.
  210.  
  211. >This is *not* just about "keeping MUI happy", much as you would like it
  212. >to be so. This is about making an 'ls' finish as fast as it could.
  213. >About your text editor responding to your typing, or scrolling your
  214. >document, when you want it to. Your CPU intensive task doesn't suffer
  215. >from being at a low priority, but your interactive tasks sure as hell
  216. >do if it isn't.
  217.  
  218. Yes. However, but what you do want is to run interactive stuff at
  219. a higher priority than CPU intensive stuff. This can be done by
  220. _lowering_ the priority of CPU intensive programs OR it can be done
  221. by _raising_ the priority of the interactive programs.
  222.  
  223. Now what is easier, especially when you think that Intuition and the
  224. console is based on the second model and the fact that most programs
  225. that require interactive responsiveness use Intuition ?
  226.  
  227. >Of course not. I don't care if two Real3D drawtasks are exchanging the
  228. >CPU every second or every 1/50th of a second.
  229.  
  230. But you do care wether AWeb presents you a page while loading or
  231. wether Executive prevents this.
  232.  
  233. >It makes no difference
  234. >to the actual completion time
  235.  
  236. But it makes a difference when the process is important and not
  237. only the completition of the process.
  238.  
  239. >"CPU intensive" generally refers to things that take many seconds and
  240. >use the CPU for their entire quantum. Tasks which are interactive will
  241. >have a higher priority, will give up the CPU often, and will still
  242. >appear to be running concurrently.
  243.  
  244. Yes, and CPU intensive tasks won't. Besides, you do not need time slices
  245. if the programs do not use up their timeslices.
  246.  
  247. >Tasks which are currently receiving
  248. >focus from the user will also be raised even higher, to ensure they
  249. >are responsive.
  250.  
  251. But which is a wild guess. In case of AWeb or other programs that
  252. are interactive _and_ need CPU time you lose.
  253.  
  254. >fast enough). It doesn't change Exec's scheduler, it doesn't make
  255. >AmigaOS non-pre-emptive.
  256.  
  257. As a matter of fact it prevents (rapid) preemption of CPU intensive
  258. tasks.
  259.  
  260. >>So another thing the user has to change to keep Executive happy.
  261.  
  262. >Executive couldn't care less. It's to keep the user happy.
  263.  
  264. The user would be happy without Executive (in this situation).
  265.  
  266. >Are you
  267. >happy waiting 4 seconds for an 'ls' that *could* have been finished in
  268. >0.5? Just because *two* other tasks are running?
  269.  
  270. Are you complaining about AWeb not displaying a page while loading ?
  271.  
  272. >>If page layout is fast enough there is no need for just another task.
  273.  
  274. >157 seconds for one page (the 600K page I was referring to earlier,
  275. >showing our site's usage statistics which I check now and then) is
  276. >quite a long time, so I suppose you're agreeing now that there *is* a
  277. >need for just another task?
  278.  
  279. If it lasts 157 seconds then there is a need for another task (or at
  280. least a heavy busy sign). But then I haven't seen anything like that
  281. and I wonder how a 600k page (which is silly btw) can take so much
  282. longer than the 50k pages that I have seen.
  283.  
  284. >If I click "<-", it still takes 18 seconds before the (small) previous
  285. >page is shown again, and 119 seconds before the big page is displayed
  286. >again if I then click "->", and I *can't* stop it if I change my mind.
  287.  
  288. You can only stop network activity.
  289.  
  290. >can prioritize them rather than making AWeb become sluggish under a
  291. >heavy load (which IBrowse doesn't).
  292.  
  293. IBrowse becomes sluggish without Executive too.
  294.  
  295. >Hmm... Just about every point I've made about why wanting the CPU
  296. >intensive code running on a separate thread at a lower priority than
  297. >the main event-handling task is completely independent of both 
  298. >Executive and MUI, yet all you ever do is blame Executive and MUI.
  299.  
  300. I do not blame it on Executive and MUI. I say that MUI requires
  301. Executive or changes in almost every program. And I do not want to
  302. change almost every program just to keep MUI happy. I'd rather use
  303. something like MUI that does not require me to change these programs.
  304.  
  305. >computer to respond to my actions instantly when it can, and running a
  306. >CPU intensive process at a low priority enables that.
  307.  
  308. And running interactive tasks at a high priority does the same and
  309. was done by Intuition - to some degree - all the time. I'm not happy
  310. if I had to change this and many other programs where you require
  311. them to spawn off CPU intensive work to other tasks. And I'm not happy
  312. to use Executive instead (at least not in its current incarnation)
  313. because it has its own problems (stalling AWeb is only one).
  314.  
  315. Going the other way round is much easier and doesn't require changes.
  316.  
  317. Regards,
  318. -- 
  319.                                 Michael van Elst
  320.  
  321. Internet: mlelstv@serpens.rhein.de
  322.                                 "A potential Snark may lurk in every tree."
  323.